<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page language="java"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<div id="contador">
    <html:link action="/getFriendList" onmouseover="document.getElementById('namigos').style.visibility = 'visible'" onmouseout="document.getElementById('namigos').style.visibility = 'hidden'">
        <div>
            <c:choose>
                <c:when test="${contador[0] == 0}">
                    <img src="./CSS/general/images/sinamigos.gif" />
                </c:when>
                <c:otherwise>
                    <img src="./CSS/general/images/conamigos.gif" />
                    <logic:present name="notificaciones">
                        <div id="namigos" class="notificaciones" style="visibility: hidden">
                            <logic:iterate id="lista" name="notificaciones">
                                <c:choose>
                                    <c:when test="${lista.tipos.idtipo < 3}">
                                        <bean:write name="lista" property="usuariosByIdemisor.alias" /> <bean:write name="lista" property="tipos.tipo"/><br/>
                                        <bean:write name="lista" property="fecha" format="hh:mm dd/MM/yyyy"/><br/>
                                    </c:when>
                                </c:choose>
                            </logic:iterate>
                        </div>
                    </logic:present>
                </c:otherwise>
            </c:choose>
        </div>
    </html:link>
    <html:link action="/getMessageList" onmouseover="document.getElementById('nmensajes').style.visibility = 'visible'" onmouseout="document.getElementById('nmensajes').style.visibility = 'hidden'">
        <div>
            <c:choose>
                <c:when test="${contador[1] == 0}">
                    <img src="./CSS/general/images/sincorreo.gif" />
                </c:when>
                <c:otherwise>
                    <img src="./CSS/general/images/concorreo.gif" />
                    <logic:present name="notificaciones">
                        <div id="nmensajes" class="notificaciones" style="visibility: hidden">
                            <logic:iterate id="lista" name="notificaciones">
                                <c:choose>
                                    <c:when test="${lista.tipos.idtipo == 3}">
                                        <bean:write name="lista" property="usuariosByIdemisor.alias" /> <bean:write name="lista" property="tipos.tipo"/><br/>
                                        <bean:write name="lista" property="fecha" format="hh:mm dd/MM/yyyy"/><br/>
                                    </c:when>
                                </c:choose>
                            </logic:iterate>
                        </div>
                    </logic:present>
                </c:otherwise>
            </c:choose>
        </div>
    </html:link>
    <html:link action="/myExercises?noti=si"  onmouseover="document.getElementById('nejercicios').style.visibility = 'visible'" onmouseout="document.getElementById('nejercicios').style.visibility = 'hidden'">
        <div>
            <c:choose>
                <c:when test="${contador[2] == 0}">
                    <img src="./CSS/general/images/sinejercicio.gif" />
                </c:when>
                <c:otherwise>
                    <img src="./CSS/general/images/conejercicio.gif" />
                    <logic:present name="notificaciones">
                        <div id="nejercicios" class="notificaciones" style="visibility: hidden">
                            <logic:iterate id="lista" name="notificaciones">
                                <c:choose>
                                    <c:when test="${lista.tipos.idtipo > 4}">
                                        <bean:write name="lista" property="usuariosByIdemisor.alias" /> <bean:write name="lista" property="tipos.tipo"/><br/>
                                        <bean:write name="lista" property="fecha" format="hh:mm dd/MM/yyyy"/><br/>
                                    </c:when>
                                </c:choose>
                            </logic:iterate>
                        </div>
                    </logic:present>
                </c:otherwise>
            </c:choose>
        </div>
    </html:link>
</div>
